package com.xit.hitmouse.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author 厦工 友敏612
 * @Date 2023/11/24
 */public class DateFormat {
    public  static Date customizeToDate(String date)  {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        Date date1 = null;
        try {
            date1 = format.parse(date);
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
        return  date1;
    }

    public  static String dateToCustomize(Date date)  {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        String date1 = format.format(date);
        return  date1;
    }
}
